package arrayList_basics.src.Object;

public class Student {
//    public公共有的,private私有的,static静态的
    private String name;
    private int age;
    private String gender;
    public static String teacherName;
    public Student(){}

    public Student(String name, int age, String gender) {
        this.name = name;
        this.age = age;
        this.gender = gender;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }
    public void study(){
        System.out.println(name+"正在学习");
    }
    public void show(){
        System.out.println(name+","+ age+","+gender+","+teacherName);
    }
    public static String printArr(int[] arr){
        StringBuffer sb = new StringBuffer();
        sb.append("[");
        for (int i = 0; i < arr.length; i++) {
            if (i== arr.length-1){
                sb.append(arr[i]);
            } else {
//                sb.append(arr[i]+",");
                sb.append(arr[i]).append(",");
            }
        }
        sb.append("]");
        return sb.toString();
    }
//    static静态方法指南访问静态数据
    public static int getBigAge(int[] arr){
        int age = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > age){}
            age = arr[i];
        }
        return age;
    }
}
